package com.ruoyi.match.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;

/**
 * 持仓信息对象 ch_posi
 * 
 * @author ruoyi
 * @date 2023-12-14
 */
public class ChPosi extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** 持仓代码 */
    @Excel(name = "持仓代码")
    private String code;

    /** 持有股票名称 */
    @Excel(name = "持有股票名称")
    private String name;

    /** 买入价格 */
    @Excel(name = "买入价格")
    private BigDecimal buyPrice;

    /** 现价 */
    @Excel(name = "现价")
    private BigDecimal currentPrice;

    /** 盈亏 */
    @Excel(name = "盈亏")
    private BigDecimal profit;

    /** 持仓数量 */
    @Excel(name = "持仓数量")
    private Long count;

    /** 持仓成本 */
    @Excel(name = "持仓成本")
    private BigDecimal cost;

    /** 持仓日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "持仓日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date created;


    private String username;


    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setCode(String code) 
    {
        this.code = code;
    }

    public String getCode() 
    {
        return code;
    }
    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }
    public void setBuyPrice(BigDecimal buyPrice) 
    {
        this.buyPrice = buyPrice;
    }

    public BigDecimal getBuyPrice() 
    {
        return buyPrice;
    }
    public void setCurrentPrice(BigDecimal currentPrice) 
    {
        this.currentPrice = currentPrice;
    }

    public BigDecimal getCurrentPrice() 
    {
        return currentPrice;
    }
    public void setProfit(BigDecimal profit) 
    {
        this.profit = profit;
    }

    public BigDecimal getProfit() 
    {
        return profit;
    }
    public void setCount(Long count) 
    {
        this.count = count;
    }

    public Long getCount() 
    {
        return count;
    }
    public void setCost(BigDecimal cost) 
    {
        this.cost = cost;
    }

    public BigDecimal getCost() 
    {
        return cost;
    }
    public void setCreated(Date created) 
    {
        this.created = created;
    }

    public Date getCreated() 
    {
        return created;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userId", getUserId())
            .append("username", getUsername())
            .append("code", getCode())
            .append("name", getName())
            .append("buyPrice", getBuyPrice())
            .append("currentPrice", getCurrentPrice())
            .append("profit", getProfit())
            .append("count", getCount())
            .append("cost", getCost())
            .append("created", getCreated())
            .toString();
    }
}
